#include <stdio.h>
#include <stdlib.h>

typedef struct point {
    int x;
    int y;
} Point;

void initPoint1(Point *pt, int x, int y)
{
    pt->x = x;
    pt->y = y;
}

void initPoint2(Point **pt, int x, int y)
{
    (*pt)->x = x;
    (*pt)->y = y;
}

int main(void)
{
    Point pt1, pt2;
    Point *p = &pt2; 

    initPoint1(&pt1, 1, 2);
    printf("pt1.x=%d,pt1.y=%d\n", pt1.x, pt1.y);
    
    initPoint2(&p, 3, 4);   
    printf("pt2.x=%d,pt2.y=%d\n", pt2.x, pt2.y);

    initPoint1(p, 5, 6);
    printf("pt2.x=%d,pt2.y=%d\n", pt2.x, pt2.y);

    return 0;
}